package com.nchu.react.webflux.config;

import com.nchu.react.webflux.component.StudentHandler;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

/**
 * @author fujianjian
 * @project react-learning
 * @date 2018/9/28 上午12:13
 */
public class StudentRouter {

    private StudentHandler studentHandler;

    public RouterFunction<ServerResponse> allRelationRouter() {

        return RouterFunctions.route(RequestPredicates.POST("/student"),
                studentHandler::createStudent);
    }
}
